<template>
  <div>
    <el-table ref="multipleTable" :data="list" tooltip-effect="dark" style="width: 100%">
      <!-- <el-table-column type="" width="55"></el-table-column> -->
      <el-table-column prop="id" label="模板ID"></el-table-column>
      <el-table-column prop="name" label="模板名称"></el-table-column>
      <el-table-column fixed="right" width="150">
        <template slot-scope="scope">
          <el-button type="text" size="small" @click="edit(scope.row)">编辑报文</el-button>
          <el-button type="text" size="small">编辑</el-button>
          <el-button type="text" size="small" @click="del(scope.row)">删除</el-button>
        </template>
      </el-table-column>
    </el-table>
    <drawer ref="drawer" :tem="tem" />
  </div>
</template>
<script>
import drawer from "./drawer.vue";
export default {
  components: {
    drawer
  },
  data() {
    return {
      list: [],
      tem: {}
    };
  },
  methods: {
    edit(row) {
      this.tem=row
      this.$refs.drawer.openDrawer();
    },
    del(row) {
      console.log(row.id)
      this.$delMB(row.id)
      this.list = this.$getMB();
    }
  },
  created() {
    this.list = this.$getMB();
  }
};
</script>